#include "main.h"
#pragma once;

int main()
{

	Engine* en = new Engine();
	/*sf::RenderWindow window(sf::VideoMode(1024, 600), "SFML works!");

	FMOD::System *system;
	FMOD::System_Create(&system);
	system->init(100, FMOD_INIT_NORMAL, 0);
	FMOD::Sound *song;
	system->createSound("Song2.mp3", FMOD_SOFTWARE, 0, &song);

	FMOD::Channel *channel;
	system->playSound(FMOD_CHANNEL_FREE, song, false, &channel);

	
	const int sampleSize = 64;
	float *specLeft, *specRight;
	
	specLeft = new float[sampleSize];
	specRight = new float[sampleSize];

	channel->getSpectrum(specLeft, sampleSize, 0, FMOD_DSP_FFT_WINDOW_RECT);
	channel->getSpectrum( specRight, sampleSize, 1, FMOD_DSP_FFT_WINDOW_RECT);
	
	float mean, specmean[sampleSize];

	sf::CircleShape rectangle;
	
	while (window.isOpen())
	{
		sf::Event event;
		while (window.pollEvent(event))
		{
			if (event.type == sf::Event::Closed)
				window.close();
		}

			channel->getSpectrum(specLeft, sampleSize, 0, FMOD_DSP_FFT_WINDOW_RECT);
			channel->getSpectrum( specRight, sampleSize, 1, FMOD_DSP_FFT_WINDOW_RECT);
			
			mean = 0;

			for (int pos = 0; pos < sampleSize - 1; pos++)
			{
				mean += (specLeft[pos] + specRight[pos]) / 2;
			}

			mean /= sampleSize;
			
			for (int pos = 0; pos < sampleSize - 1; pos++)
			{
				float mean2 = ((specLeft[pos] + specRight[pos])/2);
				if ( mean2 > (mean))
					
				{
					rectangle.setRadius(20.f);
					rectangle.setFillColor(sf::Color::Red);
					rectangle.setPosition(1024-40, ((pos*12)+12));
				}
			}

		window.clear();
		window.draw(rectangle);
		window.display();
	}*/

	//while (en->isRunning())
	en->Run();

	return 0;
}